{extends file="./main.tpl"}
{block name=head}
<style type="text/css" title="currentStyle">
  @import "./media/css/demo_page.css";
  @import "./media/css/demo_table_jui.css";
  @import "./media/css/jquery-ui-1.8.4.custom.css";
</style>
<script type="text/javascript" language="javascript" src="./media/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="./media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
  $(document).ready(function() 
  {
	  oTable = $('#example').dataTable(
	  {
		  "bJQueryUI": true,
		  "sPaginationType": "full_numbers",
		  "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
	  });
  });
</script>
<script type="text/javascript">
  $(document).ready(function() {
    $('#licenseNo').focus();
  });
function myFunction()
{
  if(confirm("You Want To Remove This Record")== true)
	{
		return true;
	}
	else
	{
		return false;
	}
}
</script>
{/block}
{block name=body}
<form name="driver" action="{$smarty.server.PHP_SELF}" method="post">
<table align="center" border="2" cellpadding="2" cellspacing="2" width="" >
<tr>
  <td align="center" class="table1" colspan="7"><b>Driver Master</b></td>
</tr>
<tr>
  <td class="table2" align="right">License No :</td>
  <td class="table2" align="left"><input type="text" name="licenseNo"  autofocus=autofocus required="required" /></td>
  <td class="table2" align="right">Name :</td>
  <td class="table2"><input type="text" name="name" ></td>
  <td class="table2" align="right">Truck No :</td>
  <td class="table2">
    <select name="truckNo" id="truckNo" required />
    <option value="0">Select Truck No</option>
	  {html_options values=$truckDataArray.truckId output=$truckDataArray.truckNo}
	  </select>
  	</td>
</tr>
<tr>
	<td class="table2" align="right" colspan="">Address :</td>
  <td class="table2" ><textarea id="" name="address" ></textarea></td>
  <td class="table2" align="right" colspan="">Telephone :</td>
  <td class="table2"><input type="text" name="telephone" ></td>
  <td class="table2" align="right" colspan="">Mobile :</td>
  <td class="table2"><input type="text" name="mobile" ></td>
</tr>
<tr>
  <td class="table1" align="center" colspan="7"><input type="submit" name="insertBtn" value="Submit" class="button" /></td>
</tr>
</table>
</form>
<br /><br />

<body id="dt_example">
	<div id="container">
  <div class="demo_jui">
	  <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
		  <thead>
			  <tr>
				  <th NOWRAP><b>&nbsp;</b></th>
					<th NOWRAP><b>License No</b></th>
					<th NOWRAP><b>Name</b></th>
					<th NOWRAP><b>Truck Name </b></th>
					<th NOWRAP><b>Address</b></th>
					<th NOWRAP><b>Telephone</b></th>
					<th NOWRAP><b>Mobile</b></th>
				</tr>
			</thead>
			<tbody>
			  {section name="sec" loop=$driverArray}
				  <tr>
				    <td align="center"><a href="driverDelete.php?driverId={$driverArray[sec].driverId}" onclick="return myFunction();" class="link"> <img src="./images/deleteIco.png"></a></td>
				    <td align="left">{$driverArray[sec].licenseNo}</td>
				    <td align="left">{$driverArray[sec].driverName} </td>
				    <td align="left">{$driverArray[sec].truckNo}</td>
					  <td align="left">{$driverArray[sec].address}</td>
				    <td align="right">{$driverArray[sec].telephone}</td>
				    <td align="right">{$driverArray[sec].mobile}</td>
				  </tr>
				{/section}
			</tbody>
		</table>
	</div>
	<div class="spacer"></div>
	</div>
</body>
{/block}